//
//  XLMatchOrderTableViewCell.m
//  XiangLove
//
//  Created by 陈宪栋 on 2018/3/7.
//  Copyright © 2018年 BAOMIHUA.COM. All rights reserved.
//

#import "XLMatchOrderTableViewCell.h"

@implementation XLMatchOrderTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.contentView.backgroundColor = kWhiteColor;
        _avatarImageView = [[UIImageView alloc] init];
        _avatarImageView.layer.masksToBounds = YES;
        _avatarImageView.layer.cornerRadius = 24;
        [self.contentView addSubview:_avatarImageView];
        [_avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView);
            make.left.equalTo(self.contentView.mas_left).offset(15);
            make.size.mas_equalTo(CGSizeMake(48, 48));
        }];
        
        _nickNameLabel = [[UILabel alloc] init];
        _nickNameLabel.textColor = [UIColor blackColor];
        _nickNameLabel.font = [UIFont systemFontOfSize:16];
        [self.contentView addSubview:_nickNameLabel];
        [_nickNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(_avatarImageView.mas_right).offset(10);
            make.top.equalTo(self.contentView.mas_top).offset(20);
            make.right.lessThanOrEqualTo(self.contentView.mas_right).offset(-60);
        }];
        self.levelImage = [[UIImageView alloc]init];
//        _levelImage.backgroundColor = kWhiteColor;

        [self.contentView addSubview:_levelImage];
        [_levelImage mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(_nickNameLabel.mas_top).offset(2);
            make.left.equalTo(_nickNameLabel.mas_right).offset(10);
            make.size.mas_equalTo(CGSizeMake(30, 15));
            
        }];
        _detailLabel = [[UILabel alloc] init];
        _detailLabel.textColor = kLightGrayColor;
        _detailLabel.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:_detailLabel];
        [_detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(_nickNameLabel.mas_left);
            make.top.equalTo(_nickNameLabel.mas_bottom).offset(4);
        }];
        
        _dialButton = [[UIButton alloc] init];
        [_dialButton setBackgroundImage:[UIImage imageNamed:@"comment_but_jieting_n"] forState:UIControlStateNormal];
        [self.contentView addSubview:_dialButton];
        [_dialButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self.contentView.mas_right).offset(-15);
            make.centerY.equalTo(self.contentView);
            make.size.mas_equalTo(CGSizeMake(36, 36));
        }];
    }
    return self;
}

@end
